package Help.Manager.Album;

import java.util.Calendar;

public class DateHelpers {
	public static int compareCalendarByMonthYear(Calendar date1, Calendar date2) {
		int month1 = date1.get(Calendar.MONTH);
		int year1 = date1.get(Calendar.YEAR);
		
		int month2 = date2.get(Calendar.MONTH);
		int year2 = date2.get(Calendar.YEAR);
		
		if(year1 == year2) {
			if(month1 == month2)
				return 0;
			
			if(month1 > month2)
				return 1;
			
			return -1;
		}
		
		if(year1 > year2)
			return 1;
		
		return -1;
	}
}
